from sqlalchemy import Column, Sequence, ForeignKey
from sqlalchemy.types import Integer, String
from __init__ import Base

class Columns(Base):

    __tablename__ = "columns"

    id = Column(Integer, Sequence('column_id_seq'), primary_key=True)
    widgetid = Column(Integer, ForeignKey('widgets.id'))
    column = Column(String(50))

    def __init__(self, widgetid, column):
        self.widgetid = widgetid
        self.column = column

    def __repr__(self):
        return "<Columns('%s', '%s')>" % (self.widgetid, self.column)
